package com.yonyou.ucf.mdf.app.isvdxq.other.model;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.google.gson.Gson;
import com.yonyou.ucf.mdf.app.isvdxq.other.entity.ProductTempSKUEntity;

@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class ProductTempSKUBean extends ProductTempSKUEntity {
    private Object name;
    private Object model;
    private Object modelDescription;

    @Override
    public String toString() {
        return new Gson().toJson(this);
    }

    public String getName() {
        if (name == null) return null;
        if(name instanceof String) return name.toString();
        else{
            NameBean obj = JSONObject.parseObject( JSONObject.toJSONString(name), NameBean.class );
            return obj.getZh_CN();
        }
    }

    public void setName(Object name) {
        this.name = name;
    }

    public String getModel() {
        if (model == null) return null;
        if (model instanceof String) return model.toString();
        else {
            NameBean obj = JSONObject.parseObject(JSONObject.toJSONString(model), NameBean.class);
            return obj.getZh_CN();
        }
    }

    public void setModel(Object model) {
        this.model = model;
    }

    public String getModelDescription() {
        if (modelDescription == null) return null;
        if(modelDescription instanceof String) return modelDescription.toString();
        else{
            NameBean obj = JSONObject.parseObject( JSONObject.toJSONString(modelDescription), NameBean.class );
            return obj.getZh_CN();
        }
    }

    public void setModelDescription(Object modelDescription) {
        this.modelDescription = modelDescription;
    }


}
